package com.dsteiner.widgets.client.rpc;

import java.util.Collection;
import java.util.List;
import java.util.Set;

import com.dsteiner.widgets.client.SuggestBoxWidget.SuggestionRequest;
import com.dsteiner.widgets.client.SuggestBoxWidget.SuggestionResult;
import com.dsteiner.widgets.client.domain.BaseObject;
import com.dsteiner.widgets.client.domain.Distinct;
import com.dsteiner.widgets.client.domain.ModelObject;
import com.google.gwt.http.client.Request;
import com.google.gwt.user.client.rpc.AsyncCallback;

public interface BaseDataServiceAsync {

	<T extends BaseObject> Request search(SearchRequest searchRequest, AsyncCallback<SearchResult<T>> asyncCallback);

	<T extends ModelObject> Request getObjectById(String userId, String objectClassName, AsyncCallback<CrudResult<T>> asyncCallback);

	<T extends ModelObject> Request createModelObject(ModelObject modelObject, AsyncCallback<CrudResult<T>> asyncCallback);

	<T extends ModelObject> Request deleteObject(ModelObject modelObject, AsyncCallback<CrudResult<T>> asyncCallback);
	
	<T extends ModelObject> Request updateObject(ModelObject modelObject, AsyncCallback<CrudResult<T>> asyncCallback);

	Request getSuggestions(SuggestionRequest request, AsyncCallback<SuggestionResult> asyncCallback);
}
